package com.osdp.base.vo;

import com.osdp.common.base.BaseVo;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 *  树型结构字典表
 * </p>
 *
 * @Author
 * @since
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class SysDictItemVo extends BaseVo {

    private static final long serialVersionUID = 1L;

    public static final String ROOT_PARENT_ID = "0";
    /**
     * 父id
     */
    private String parentId;

    /**
     * 字典项文本
     */
    private String itemText;

    /**
     * 字典项值
     */
    private String itemValue;

    /**
     * 描述
     */
    private String description;

    /**
     * 排序
     */
    private Integer sortNo;


    /**
     * 编码code
     */
    private String dictItemCode;

    /**
     * 字典级别，0系统，1用户
     */
//    private Integer level;


    /**
     * 判断ID是否根节点
     * @param id
     * @return
     */
    public static boolean root(String id){
        return "0".equals(id);
    }


    public SysDictItemVo(String itemText, String itemValue, String dictItemCode) {
        this.itemText = itemText;
        this.itemValue = itemValue;
        this.dictItemCode = dictItemCode;
    }
}
